<template>
  <div>
    <!-- 面包屑导航区 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>管理员管理</el-breadcrumb-item>
      <el-breadcrumb-item>管理员列表</el-breadcrumb-item>
    </el-breadcrumb>

    <!-- 卡片视图 -->
    <el-card>
      <h3>管理员个人信息</h3>
      <!-- 用户列表区域 -->
      <el-table :data="pageData1" border stripe >
        
        <el-table-column label="管理员用户名" prop="username" >
         
        </el-table-column>
        <el-table-column label="管理员密码" prop="password"></el-table-column>
        <el-table-column label="权限" prop="permission"></el-table-column>
       
        <el-table-column label="操作">
          <template slot-scope="scope">
            
            <el-button size="mini" @click="updateId(scope.row._id)">修改</el-button>
          
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页区域 -->

    
    </el-card>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
  "admin"
);

export default {
  computed: {
    ...mapState(["pageData1"]),
  },
  created() {
  
      // this.isLogin();
     
      var _this=this
     async function  getId(){
     
           const {_id}=await _this.isLogin()
           _this.getAdminById(_id)
           console.log(_id)
      }
      getId()
      
      // 
      
  },
  methods: {
    ...mapActions(["isLogin","getAdminById"]),
   
    
   
    //修改
    updateId(_id){
          this.$router.push({
                path:'/UpdateAdmin',
                query:{
                      _id
                }
              })
    }
  },
};
</script>

<style>
</style>